home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 December / maximum-cd-2009-12.iso / DiscContents / gimp-2.7.0-i686-setup.exe / {app} / share / gimp / 2.0 / scripts / gimp-labels.scm < prev    next >
Encoding:
Text File  |  2009-08-19  |  7.2 KB  |  191 lines

  1. ; GIMP - The GNU Image Manipulation Program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ;
  4. ; www.gimp.org web labels
  5. ; Copyright (c) 1997 Adrian Likins
  6. ; aklikins@eos.ncsu.edu
  7. ;
  8. ; based on a idea by jtl (Jens  Lautenbacher)
  9. ; and improved by jtl
  10. ;
  11. ; This program is free software: you can redistribute it and/or modify
  12. ; it under the terms of the GNU General Public License as published by
  13. ; the Free Software Foundation; either version 3 of the License, or
  14. ; (at your option) any later version.
  15. ;
  16. ; This program is distributed in the hope that it will be useful,
  17. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. ; GNU General Public License for more details.
  20. ;
  21. ; You should have received a copy of the GNU General Public License
  22. ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
  23. ;
  24. ;  **NOTE**  This fonts use some very common fonts, that are typically
  25. ;  bitmap fonts on most installations. If you want better quality versions
  26. ;  you need to grab the urw font package form www.gimp.org/fonts.html
  27. ;  and install as indicated. This will replace the some current bitmap fonts
  28. ;  with higher quality vector fonts. This is how the actual www.gimp.org
  29. ;  logos were created.
  30. ;
  31. ; ************************************************************************
  32. ; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
  33. ; For use with GIMP 1.1.
  34. ; All calls to gimp-text-* have been converted to use the *-fontname form.
  35. ; The corresponding parameters have been replaced by an SF-FONT parameter.
  36. ; ************************************************************************
  37.  
  38.  
  39. (define (script-fu-labels-gimp-org text font font-size text-color
  40.                                    shadow-color bg-color rm-bg index
  41.                                    num-colors color-thresh yoff xoff height)
  42.   (let* (
  43.         (img (car (gimp-image-new 125 height RGB)))
  44.         (text-layer (car (gimp-text-fontname img -1 xoff yoff text 0
  45.                                     TRUE font-size PIXELS
  46.                                     font)))
  47.         (bg-layer (car (gimp-layer-new  img 125 height
  48.                                         RGB-IMAGE "Background" 100 NORMAL-MODE)))
  49.         (shadow-layer (car (gimp-layer-copy text-layer TRUE)))
  50.         )
  51.  
  52.     (gimp-context-push)
  53.  
  54.     (gimp-image-undo-disable img)
  55.     (gimp-image-add-layer img shadow-layer 1)
  56.     (gimp-image-add-layer img bg-layer 2)
  57.  
  58.     (gimp-layer-set-lock-alpha text-layer TRUE)
  59.     (gimp-layer-set-lock-alpha shadow-layer TRUE)
  60.  
  61.     (gimp-context-set-background text-color)
  62.     (gimp-edit-fill text-layer BACKGROUND-FILL)
  63.  
  64.     (gimp-context-set-background bg-color)
  65.     (gimp-edit-fill bg-layer BACKGROUND-FILL)
  66.  
  67.     (gimp-context-set-background shadow-color)
  68.     (gimp-edit-fill shadow-layer BACKGROUND-FILL)
  69.     (gimp-layer-translate shadow-layer 1 1)
  70.  
  71.     (set! text-layer (car (gimp-image-flatten img)))
  72.     (gimp-layer-add-alpha text-layer)
  73.  
  74.     (if (= rm-bg TRUE)
  75.         (begin
  76.           (gimp-by-color-select text-layer bg-color
  77.                                 color-thresh CHANNEL-OP-REPLACE TRUE FALSE 0 FALSE)
  78.           (gimp-edit-clear text-layer)
  79.           (gimp-selection-none img)
  80.         )
  81.     )
  82.  
  83.     (if (= index TRUE)
  84.         (gimp-image-convert-indexed img FS-DITHER MAKE-PALETTE num-colors
  85.                                     FALSE FALSE "")
  86.     )
  87.  
  88.     (gimp-image-undo-enable img)
  89.     (gimp-display-new img)
  90.  
  91.     (gimp-context-pop)
  92.   )
  93. )
  94.  
  95.  
  96. ;;;(define (script-fu-tube-button-label-gimp-org text rm-bg index)
  97. ;;;  (script-fu-labels-gimp-org text "nimbus sans" 14 "medium" "r" "normal" '(151 177 192) '(0 0 0) '(255 255 255) rm-bg index 15 1 8 0 30))
  98. ;;;
  99. ;;;(define (script-fu-tube-subbutton-label-gimp-org text rm-bg index)
  100. ;;;  (script-fu-labels-gimp-org text "nimbus sans" 12 "medium" "r" "normal" '(151 177 192) '(0 0 0) '(255 255 255) rm-bg index 15 1 7 0 24))
  101. ;;;
  102. ;;;(define (script-fu-tube-subsubbutton-label-gimp-org text rm-bg index)
  103. ;;;  (script-fu-labels-gimp-org text "nimbus sans" 10 "medium" "r" "normal" '(151 177 192) '(0 0 0) '(255 255 255) rm-bg index 15 1 6 0 18))
  104. ;;;
  105.  
  106. (define (script-fu-tube-button-label-gimp-org text rm-bg index)
  107.   (script-fu-labels-gimp-org text "helvetica" 14 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 8 0 30)
  108. )
  109.  
  110. (define (script-fu-tube-subbutton-label-gimp-org text rm-bg index)
  111.   (script-fu-labels-gimp-org text "helvetica" 12 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 7 10 24)
  112. )
  113.  
  114. (define (script-fu-tube-subsubbutton-label-gimp-org text rm-bg index)
  115.   (script-fu-labels-gimp-org text "helvetica" 10 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 6 20 18)
  116. )
  117.  
  118.  
  119. (script-fu-register "script-fu-tube-button-label-gimp-org"
  120.   _"_Tube Button Label..."
  121.   _"Create an image of a Tube Button Label using the gimp.org webpage theme"
  122.   "Adrian Likins & Jens Lautenbacher"
  123.   "Adrian Likins & Jens Lautenbacher"
  124.   "1997"
  125.   ""
  126.   SF-STRING _"Text"              "?"
  127.   SF-TOGGLE _"Remove background" TRUE
  128.   SF-TOGGLE _"Index image"       TRUE
  129. )
  130.  
  131. (script-fu-menu-register "script-fu-tube-button-label-gimp-org"
  132.                          "<Image>/File/Create/Web Page Themes/Classic.Gimp.Org")
  133.  
  134.  
  135. (script-fu-register "script-fu-tube-subbutton-label-gimp-org"
  136.   _"T_ube Sub-Button Label..."
  137.   _"Create an image of a second level Tube Button Label using the gimp.org webpage theme"
  138.   "Adrian Likins & Jens Lautenbacher"
  139.   "Adrian Likins & Jens Lautenbacher"
  140.   "1997"
  141.   ""
  142.   SF-STRING _"Text"              "?"
  143.   SF-TOGGLE _"Remove background" TRUE
  144.   SF-TOGGLE _"Index image"       TRUE
  145. )
  146.  
  147. (script-fu-menu-register "script-fu-tube-subbutton-label-gimp-org"
  148.                          "<Image>/File/Create/Web Page Themes/Classic.Gimp.Org")
  149.  
  150.  
  151. (script-fu-register "script-fu-tube-subsubbutton-label-gimp-org"
  152.   _"Tub_e Sub-Sub-Button Label..."
  153.   _"Create an image of a third level Tube Button Label using the gimp.org webpage theme"
  154.   "Adrian Likins & Jens Lautenbacher"
  155.   "Adrian Likins & Jens Lautenbacher"
  156.   "1997"
  157.   ""
  158.   SF-STRING _"Text"              "?"
  159.   SF-TOGGLE _"Remove background" TRUE
  160.   SF-TOGGLE _"Index image"       TRUE
  161. )
  162.  
  163. (script-fu-menu-register "script-fu-tube-subsubbutton-label-gimp-org"
  164.                          "<Image>/File/Create/Web Page Themes/Classic.Gimp.Org")
  165.  
  166.  
  167. (script-fu-register "script-fu-labels-gimp-org"
  168.   _"_General Tube Labels..."
  169.   _"Create an image of a Tube Button Label Header using the gimp.org webpage theme"
  170.   "Adrian Likins & Jens Lautenbacher"
  171.   "Adrian Likins & Jens Lautenbacher"
  172.   "1997"
  173.   ""
  174.   SF-STRING     _"Text"               "Gimp.Org"
  175.   SF-FONT       _"Font"               "Sans"
  176.   SF-ADJUSTMENT _"Font size (pixels)" '(18 2 1000 1 10 0 1)
  177.   SF-COLOR      _"Text color"         '(130 165 235)
  178.   SF-COLOR      _"Shadow color"       "black"
  179.   SF-COLOR      _"Background color"   "white"
  180.   SF-TOGGLE     _"Remove background"  TRUE
  181.   SF-TOGGLE     _"Index image"        TRUE
  182.   SF-ADJUSTMENT _"Number of colors"   '(15 2 255 1 10 0 1)
  183.   SF-ADJUSTMENT _"Select-by-color threshold" '(1 1 256 1 10 0 1)
  184.   SF-ADJUSTMENT _"Offset X"           '(8 0 50 1 10 0 1)
  185.   SF-ADJUSTMENT _"Offset Y"           '(0 0 50 1 10 0 1)
  186.   SF-ADJUSTMENT _"Height"             '(30 2 1000 1 10 0 1)
  187. )
  188.  
  189. (script-fu-menu-register "script-fu-labels-gimp-org"
  190.                          "<Image>/File/Create/Web Page Themes/Classic.Gimp.Org")
  191.